<%@ page language="java" import="java.util.*"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>录入人员信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="css/style.css" rel="stylesheet" type="text/css"></link>
<link type="text/css" href="jquery/jquery-ui-1.8.19.custom.css" rel="stylesheet"></link>
<link rel="stylesheet" type="text/css" href="jquery/flexigrid.pack.css"></link>
<script type="text/javascript" src="jquery/jquery.min.js"></script>
<script type="text/javascript" src="jquery/jquery-ui-1.8.19.custom.min.js"></script>
<script type="text/javascript" src="jquery/flexigrid.pack.js"></script>
<script src="script/commons.js" type="text/javascript"></script>
<script src="script/calendar.js" type="text/javascript"></script>
<script src="script/objects.js" type="text/javascript"></script>
<script type="text/javascript">
	var searchKey = '${s}';
	var isSearching = '${isSearching}';

	$(function(e) {
        if(isSearching == "searching") {
			$("#searchKey").val(searchKey);
		}
		var gridHeight = window.screen.availHeight - 350;
		$("#mainTable").flexigrid({height:gridHeight});
    });
	
	pager.currentPage = "${page.currentPage}";
	pager.action = "balanceallinfo.do";
	pager.getParam = function() {
		if(isSearching == "searching") {
			return "&s=" + $("#searchKey").val();
		}
		return "";
	};

	function doSearch(){
		to("balanceallinfo.do?s=" + $("#searchKey").val());
	}
</script>
<style type="text/css">
#searchTitle {
	position: relative;
	top: -1px;
	left: 45px;
	font-size: 13px;
}
#searchKey {
	padding-left: 45px;
	width: 150px;
}
#setWidth {
	width: 100%;
}
</style>
</head>
<body>
	<form action="receiptallinfo.do" method="post">
        <div id="setWidth">
        <div class="button_bar">
			<button class="common_button" onclick="to('forwardbalanceadd.do');">
				<img alt="新增" src="images/mainButton/addbutton.gif" width="12px;" />新增
			</button>
            <button class="common_button" onclick="deleteSelected('b', false)">
				<img alt="删除" src="images/bt_del_13x13.gif" width="12px;"/>删除
			</button>
            <button class="common_button" onclick="deleteSelected('b', true)">
				<img alt="记账" src="images/bt_yes_13x13.gif" width="12px;"/>记账
			</button>
            <label><span id="searchTitle">客户名:</span><input
				id="searchKey" name="searchKey" type="text" />
			</label>
			<button class="common_button" onclick="doSearch()">
				<img alt="新增" src="images/mainButton/search1.gif" width="12px;" />查询
			</button>
		</div>
		<table id="mainTable">
			<thead>
            	<tr>
                    <th width="20">
                    <input type="checkbox" style="vertical-align:middle" onclick="checkAllChecker()" /></th>
                    <th width="100">单据编号</th>
                    <th width="150">渠道名称</th>
                    <th width="150">店铺名称</th>
                    <th width="100">日期</th>
                    <th width="100">制单日期</th>
                    <th width="100" class="closeDate">记账日期</th>
                    <th width="100">费用性质</th>
                    <th width="100">金额（元）</th>
                    <th width="100">店铺面积（m²）</th>
                    <th width="100">备注</th>
                </tr>
            </thead>
            <tbody>
        <c:if test="${list!=null}" var="sel">
        <c:forEach var="list" items="${list}" varStatus="i">
        	<tr>
            	<td class="list_data_box">
                <c:if test="${list.isClosed == false}">
                <input type="checkbox" name="checker" style="vertical-align:middle" value="${list.balanceId}" onpropertychange="changeColor(this)" />
                </c:if></td>
                <td>
                <c:if test="${list.isClosed == false}">
                <a href="forwardbalanceadd.do?modifyId=${list.balanceId}"></c:if>
                B${list.balanceId}
                <c:if test="${list.isClosed == false}">
                </a></c:if>
                </td>
                <td>${list.finCustomer.customer}</td>
                <td>${list.shop.customer}</td>
                <td>${list.fitmentDate}</td>
                <td>${list.writeDate}</td>
                <td class="closeDate">
                <c:choose>
                    <c:when test="${list.closeDate == null}">
                    -
                    </c:when>
                    <c:otherwise>
                    ${list.closeDate}
                    </c:otherwise>
                </c:choose></td>
                <td>${list.costProperty}</td>
                <td>${list.balancePrice2}</td>
                <td>${list.shopArea}</td>
                <td>${list.balanceRemark}</td>
            </tr>
        </c:forEach>
        </c:if>
        	</tbody>
		</table>
        <div class="footer">
        	<a href="javascript:void()" onclick="pager.first()">
            <img alt="第一页" src="images/mainButton/pagefirst.gif" width="10px;" border="0px;">
            </a>
            <a href="javascript:void()" onclick="pager.previous()">
            <img alt="上一页" src="images/mainButton/pageprev.gif" width="60px;"
                border="0px;">
            </a>
            <a href="javascript:void()" onclick="pager.next()">
            <img alt="下一页" src="images/mainButton/pagenext.gif" width="60px;"
                border="0px;">
            </a>
            <a href="javascript:void()" onclick="pager.last()">
            <img alt="最后一页" src="images/mainButton/pageafter.gif" width="10px;"
                border="0px;">
            </a>
            共${page.totalRows}条记录 每页 ${page.pageSize} 条 第 ${page.currentPage}
            页/共${page.totalPages}页
        </div>
        </div>
	</form>
</body>

</html>